<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>props 函数式组件</title>
</head>
<body>
    <div id="root"></div>
    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>
    <script type="text/babel">
        let xingyu = {
            name: '星雨',
            age: 20,
            gender: '男'
        }

        let xiaoqin = {
            name: '晓琴',
            age: 18,
            gender: '女'
        }

        //函数式组件
        function Student(props){
            // console.log(props);
            let {name, age, gender} = props;
            return <ul>
                    <li>姓名: {name}</li>
                    <li>年龄: {age}</li>
                    <li>性别: {gender}</li>
                </ul>
        }

        //渲染组件
        ReactDOM.render(
            <div>
                <Student name={xingyu.name} age={xingyu.age} gender={xingyu.gender} /> 
                <Student {...xiaoqin} /> 
            </div>,
            document.querySelector("#root"));


    </script>
</body>
</html>